home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 5_2007-2008.ISO / data / Zips / Two-dimens204718292007.psc / 2 d array any class final / 2 d array earlier long only version class / myarray.frm < prev    next >
Text File  |  2007-02-07  |  12KB  |  408 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    AutoRedraw      =   -1  'True
  4.    BackColor       =   &H00FFFFFF&
  5.    BorderStyle     =   5  'Sizable ToolWindow
  6.    Caption         =   "2d array class"
  7.    ClientHeight    =   7764
  8.    ClientLeft      =   48
  9.    ClientTop       =   288
  10.    ClientWidth     =   10104
  11.    BeginProperty Font 
  12.       Name            =   "MS Sans Serif"
  13.       Size            =   12
  14.       Charset         =   0
  15.       Weight          =   700
  16.       Underline       =   0   'False
  17.       Italic          =   0   'False
  18.       Strikethrough   =   0   'False
  19.    EndProperty
  20.    LinkTopic       =   "Form1"
  21.    MaxButton       =   0   'False
  22.    MinButton       =   0   'False
  23.    ScaleHeight     =   647
  24.    ScaleMode       =   3  'Pixel
  25.    ScaleWidth      =   842
  26.    ShowInTaskbar   =   0   'False
  27.    StartUpPosition =   2  'CenterScreen
  28.    Begin VB.CommandButton Command1 
  29.       BackColor       =   &H00C0FFFF&
  30.       Caption         =   "new"
  31.       Height          =   372
  32.       Index           =   11
  33.       Left            =   8520
  34.       Style           =   1  'Graphical
  35.       TabIndex        =   32
  36.       Top             =   840
  37.       Width           =   1332
  38.    End
  39.    Begin VB.CommandButton Command1 
  40.       BackColor       =   &H00C0E0FF&
  41.       Caption         =   "cut range"
  42.       Height          =   372
  43.       Index           =   10
  44.       Left            =   6600
  45.       Style           =   1  'Graphical
  46.       TabIndex        =   31
  47.       Top             =   7200
  48.       Width           =   3372
  49.    End
  50.    Begin VB.TextBox Text1 
  51.       Height          =   492
  52.       Index           =   15
  53.       Left            =   3960
  54.       TabIndex        =   28
  55.       Text            =   "8"
  56.       Top             =   5400
  57.       Width           =   732
  58.    End
  59.    Begin VB.TextBox Text1 
  60.       Height          =   492
  61.       Index           =   14
  62.       Left            =   2760
  63.       TabIndex        =   26
  64.       Text            =   "3"
  65.       Top             =   5400
  66.       Width           =   732
  67.    End
  68.    Begin VB.TextBox Text1 
  69.       Height          =   492
  70.       Index           =   13
  71.       Left            =   2040
  72.       TabIndex        =   25
  73.       Text            =   "2"
  74.       Top             =   5400
  75.       Width           =   732
  76.    End
  77.    Begin VB.CommandButton Command1 
  78.       BackColor       =   &H00808080&
  79.       Caption         =   "Set item"
  80.       Height          =   372
  81.       Index           =   9
  82.       Left            =   120
  83.       Style           =   1  'Graphical
  84.       TabIndex        =   24
  85.       Top             =   5400
  86.       Width           =   1812
  87.    End
  88.    Begin VB.CommandButton Command1 
  89.       BackColor       =   &H00FFC0C0&
  90.       Caption         =   "Set Range to Value"
  91.       Height          =   372
  92.       Index           =   8
  93.       Left            =   5760
  94.       Style           =   1  'Graphical
  95.       TabIndex        =   23
  96.       Top             =   5640
  97.       Width           =   3252
  98.    End
  99.    Begin VB.TextBox Text1 
  100.       Height          =   492
  101.       Index           =   12
  102.       Left            =   9240
  103.       TabIndex        =   22
  104.       Text            =   "8"
  105.       Top             =   5520
  106.       Width           =   732
  107.    End
  108.    Begin VB.CommandButton Command1 
  109.       Caption         =   "new lower bound rows"
  110.       Height          =   372
  111.       Index           =   7
  112.       Left            =   6120
  113.       TabIndex        =   21
  114.       Top             =   3360
  115.       Width           =   2772
  116.    End
  117.    Begin VB.TextBox Text1 
  118.       Height          =   492
  119.       Index           =   11
  120.       Left            =   9120
  121.       TabIndex        =   20
  122.       Text            =   "8"
  123.       Top             =   3360
  124.       Width           =   732
  125.    End
  126.    Begin VB.TextBox Text1 
  127.       Height          =   492
  128.       Index           =   10
  129.       Left            =   9120
  130.       TabIndex        =   19
  131.       Text            =   "8"
  132.       Top             =   2160
  133.       Width           =   732
  134.    End
  135.    Begin VB.CommandButton Command1 
  136.       Caption         =   "new lower bound cols"
  137.       Height          =   372
  138.       Index           =   6
  139.       Left            =   6120
  140.       TabIndex        =   18
  141.       Top             =   2760
  142.       Width           =   2772
  143.    End
  144.    Begin VB.TextBox Text1 
  145.       Height          =   492
  146.       Index           =   9
  147.       Left            =   9120
  148.       TabIndex        =   17
  149.       Text            =   "8"
  150.       Top             =   2760
  151.       Width           =   732
  152.    End
  153.    Begin VB.CommandButton Command1 
  154.       BackColor       =   &H00E0E0E0&
  155.       Caption         =   "redim preserve rows"
  156.       Height          =   372
  157.       Index           =   5
  158.       Left            =   6120
  159.       Style           =   1  'Graphical
  160.       TabIndex        =   16
  161.       Top             =   2160
  162.       Width           =   2772
  163.    End
  164.    Begin VB.TextBox Text1 
  165.       Height          =   492
  166.       Index           =   8
  167.       Left            =   9120
  168.       TabIndex        =   15
  169.       Text            =   "8"
  170.       Top             =   1680
  171.       Width           =   732
  172.    End
  173.    Begin VB.CommandButton Command1 
  174.       BackColor       =   &H00E0E0E0&
  175.       Caption         =   "redim preserve cols"
  176.       Height          =   372
  177.       Index           =   4
  178.       Left            =   6120
  179.       Style           =   1  'Graphical
  180.       TabIndex        =   14
  181.       Top             =   1680
  182.       Width           =   2772
  183.    End
  184.    Begin VB.TextBox Text1 
  185.       Height          =   492
  186.       Index           =   7
  187.       Left            =   7680
  188.       TabIndex        =   12
  189.       Text            =   "4"
  190.       Top             =   5040
  191.       Width           =   732
  192.    End
  193.    Begin VB.TextBox Text1 
  194.       Height          =   492
  195.       Index           =   6
  196.       Left            =   7680
  197.       TabIndex        =   11
  198.       Text            =   "1"
  199.       Top             =   4560
  200.       Width           =   732
  201.    End
  202.    Begin VB.TextBox Text1 
  203.       Height          =   492
  204.       Index           =   5
  205.       Left            =   9120
  206.       TabIndex        =   10
  207.       Text            =   "4"
  208.       Top             =   4080
  209.       Width           =   732
  210.    End
  211.    Begin VB.TextBox Text1 
  212.       Height          =   492
  213.       Index           =   4
  214.       Left            =   8400
  215.       TabIndex        =   9
  216.       Text            =   "1"
  217.       Top             =   4080
  218.       Width           =   732
  219.    End
  220.    Begin VB.CommandButton Command1 
  221.       BackColor       =   &H00C0C0C0&
  222.       Caption         =   "sort range horizontal descending"
  223.       Height          =   372
  224.       Index           =   3
  225.       Left            =   5760
  226.       Style           =   1  'Graphical
  227.       TabIndex        =   7
  228.       Top             =   6720
  229.       Width           =   4212
  230.    End
  231.    Begin VB.CommandButton Command1 
  232.       BackColor       =   &H00C0C0C0&
  233.       Caption         =   "sort range horizontal ascending"
  234.       Height          =   372
  235.       Index           =   2
  236.       Left            =   5760
  237.       Style           =   1  'Graphical
  238.       TabIndex        =   6
  239.       Top             =   6240
  240.       Width           =   4212
  241.    End
  242.    Begin VB.CommandButton Command1 
  243.       BackColor       =   &H00C0C0C0&
  244.       Caption         =   "sort range vertical descending"
  245.       Height          =   372
  246.       Index           =   1
  247.       Left            =   1440
  248.       Style           =   1  'Graphical
  249.       TabIndex        =   5
  250.       Top             =   6720
  251.       Width           =   4212
  252.    End
  253.    Begin VB.CommandButton Command1 
  254.       BackColor       =   &H00C0C0C0&
  255.       Caption         =   "sort range vertical ascending"
  256.       Height          =   372
  257.       Index           =   0
  258.       Left            =   1440
  259.       Style           =   1  'Graphical
  260.       TabIndex        =   4
  261.       Top             =   6240
  262.       Width           =   4212
  263.    End
  264.    Begin VB.TextBox Text1 
  265.       Height          =   492
  266.       Index           =   3
  267.       Left            =   7680
  268.       TabIndex        =   3
  269.       Text            =   "8"
  270.       Top             =   1200
  271.       Width           =   732
  272.    End
  273.    Begin VB.TextBox Text1 
  274.       Height          =   492
  275.       Index           =   2
  276.       Left            =   7680
  277.       TabIndex        =   2
  278.       Text            =   "0"
  279.       Top             =   600
  280.       Width           =   732
  281.    End
  282.    Begin VB.TextBox Text1 
  283.       Height          =   492
  284.       Index           =   1
  285.       Left            =   9240
  286.       TabIndex        =   1
  287.       Text            =   "10"
  288.       Top             =   120
  289.       Width           =   732
  290.    End
  291.    Begin VB.TextBox Text1 
  292.       Height          =   492
  293.       Index           =   0
  294.       Left            =   8280
  295.       TabIndex        =   0
  296.       Text            =   "2"
  297.       Top             =   120
  298.       Width           =   732
  299.    End
  300.    Begin VB.Shape Shape1 
  301.       Height          =   972
  302.       Left            =   0
  303.       Top             =   5160
  304.       Width           =   5292
  305.    End
  306.    Begin VB.Label Label4 
  307.       BackStyle       =   0  'Transparent
  308.       Caption         =   "row"
  309.       Height          =   252
  310.       Index           =   1
  311.       Left            =   2040
  312.       TabIndex        =   30
  313.       Top             =   5160
  314.       Width           =   852
  315.    End
  316.    Begin VB.Label Label4 
  317.       BackStyle       =   0  'Transparent
  318.       Caption         =   "col"
  319.       Height          =   252
  320.       Index           =   0
  321.       Left            =   2760
  322.       TabIndex        =   29
  323.       Top             =   5160
  324.       Width           =   852
  325.    End
  326.    Begin VB.Label Label3 
  327.       BackStyle       =   0  'Transparent
  328.       Caption         =   "to"
  329.       Height          =   372
  330.       Left            =   3600
  331.       TabIndex        =   27
  332.       Top             =   5520
  333.       Width           =   372
  334.    End
  335.    Begin VB.Label Label2 
  336.       BackStyle       =   0  'Transparent
  337.       Caption         =   "Dimensions:"
  338.       Height          =   372
  339.       Left            =   6120
  340.       TabIndex        =   13
  341.       Top             =   720
  342.       Width           =   1572
  343.    End
  344.    Begin VB.Label Label1 
  345.       BackStyle       =   0  'Transparent
  346.       Caption         =   "range:"
  347.       Height          =   492
  348.       Left            =   6120
  349.       TabIndex        =   8
  350.       Top             =   4440
  351.       Width           =   1572
  352.    End
  353. End
  354. Attribute VB_Name = "Form1"
  355. Attribute VB_GlobalNameSpace = False
  356. Attribute VB_Creatable = False
  357. Attribute VB_PredeclaredId = True
  358. Attribute VB_Exposed = False
  359. Dim ARR2D As New Array2d
  360.  
  361. Private Sub Form_Load()
  362. With ARR2D
  363. .ZeroBaseDimension 5, 5
  364. .setValue 0, 0, 6
  365. .setValue 3, 3, 10
  366. .setValue 2, 1, 7
  367. .setRow 1, 5
  368. .setcol 2, 3
  369. .DoSwap 1, 1, 3, 3
  370. .doprint Me
  371. End With
  372. End Sub
  373.  
  374. Private Sub Command1_Click(Index As Integer)
  375. With ARR2D
  376. Select Case Index
  377. Case 0
  378. ARR2D.dosort Val(Text1(6)), Val(Text1(4)), Val(Text1(7)), Val(Text1(5)), True, True
  379. Case 1
  380. ARR2D.dosort Val(Text1(6)), Val(Text1(4)), Val(Text1(7)), Val(Text1(5)), True, False
  381. Case 2
  382. ARR2D.dosort Val(Text1(6)), Val(Text1(4)), Val(Text1(7)), Val(Text1(5)), False, True
  383. Case 3
  384. ARR2D.dosort Val(Text1(6)), Val(Text1(4)), Val(Text1(7)), Val(Text1(5)), False, False
  385. Case 4
  386. .redimPreserveCols Val(Text1(8))
  387. Case 5
  388. .redimPreserveROWS Val(Text1(10))
  389. Case 6
  390. .resetColBounds Val(Text1(9))
  391.  
  392. Case 7
  393. .resetRowBounds Val(Text1(11))
  394. Case 8
  395. .setRange Val(Text1(6)), Val(Text1(4)), Val(Text1(7)), Val(Text1(5)), Val(Text1(12))
  396.  
  397. Case 9
  398. .setValue Val(Text1(13)), Val(Text1(14)), Val(Text1(15))
  399. Case 10
  400. .cutArray Val(Text1(6)), Val(Text1(4)), Val(Text1(7)), Val(Text1(5))
  401. Case 11
  402. .dimension Val(Text1(2)), Val(Text1(3)), Val(Text1(0)), Val(Text1(1))
  403. End Select
  404. ARR2D.doprint Me
  405. End With
  406. End Sub
  407.  
  408.